import request from '@/utils/request'

export interface StatisticsData {
  totalStudents: number
  totalClasses: number
  totalDepts: number
  totalScores: number
  studentsByDept: Array<{ name: string; value: number }>
  studentsByClass: Array<{ name: string; value: number }>
  scoreDistribution: Record<string, number>
  genderDistribution: Record<string, number>
}

/**
 * 获取统计数据
 */
export function getStatistics() {
  return request<StatisticsData>({
    url: '/statistics',
    method: 'get'
  })
}

